package com.york.tinyrpc.example.provider;

import com.york.tinyrpc.example.common.service.UserService;
import com.york.tinyrpc.protoss.bootstrap.TinyRpcProviderBootstrap;
import com.york.tinyrpc.protoss.model.ServiceRegistryInfo;

import java.util.ArrayList;
import java.util.List;

public class ProviderExample {

    public static void main(String[] args) {

        // 提供方准备 服务列表信息
        List<ServiceRegistryInfo<?>> serviceRegistryInfos = new ArrayList<>();
        ServiceRegistryInfo<UserService> serviceRegistryInfo =
                new ServiceRegistryInfo(UserService.class.getName(), UserServiceImpl.class);
        serviceRegistryInfos.add(serviceRegistryInfo);
        // 初始化
        TinyRpcProviderBootstrap.init(serviceRegistryInfos);
    }

}
